Array of search objects.

<div class="definition">
    Array, default = []
</div>

The <span class="argument">.searches</span> property can be initialized during the object creation or any time
during the run-time. There is no need to refresh the grid because this array will be used when user executes a search.
<div style="height: 10px"></div>

Searches can be defined during object creation:
<textarea class="javascript">
let grid = new w2grid({
    name : 'grid',
    show : { toolbar : true },
    columns : [
        { field: 'recid', text: 'ID', size: '50px' },
        { field: 'lname', text: 'Last Name', size: '30%' },
        { field: 'fname', text: 'First Name', size: '30%' },
        { field: 'email', text: 'Email', size: '40%' },
        { field: 'sdate', text: 'Start Date', size: '120px' },
        { field: 'sdate', text: 'End Date', size: '120px' }
    ],
    searches : [
        { field: 'recid', text: 'ID (int)', type: 'int' },
        { field: 'id', text: 'ID (float)', type: 'float' },
        { field: 'fname', text: 'First Name', type: 'text' },
        { field: 'lname', text: 'Last Name', type: 'text' },
        { field: 'email', text: 'Email', type: 'list',
            options: { items: ['vitali@gmail.com', 'jim@gmail.com'] } },
        { field: 'sdate', text: 'Date', type: 'date' }
    ]
});
</textarea>

Or it can be changed during run-time:

<textarea class="javascript">
grid.searches[0] = { field: 'recid', text: 'ID', type: 'int' };
</textarea>

Because the only way for the user to trigger the search is from the toolbar, the <a class="argument" href="w2grid.show">.show.toolbar</a> and
<a class="argument" href="w2grid.show">.show.toolbarSearch</a> properties should be set to true.
<div style="height: 10px"></div>

Below it the structure of the search object:
<textarea class="javascript">
search = {
    type     : 'text', // type of the search (see below)
    field    : '',     // field name to submit to server
    label    : '',     // caption of the search
    style    : '',     // additional style for the field
    attr     : '',     // text that will be inside &lt;input ...&gt; tag
    text     : '',     // text that will be outside &lt;input ...&gt; tag
    simple   : true,   // if true, it will show in simple search drop down
    hidden   : false,  // if hidden = true it will always be submitted, but user cannot clear it
    value    : null,   // default value for hidden search
    operator : null,   // defines default operator for the field
    operators: null,   // array of operators for the field, or default is used
    options  : {}      // options for w2field object
}
</textarea>

Initially the default search field is "all", however, you can remove it or define a different search field. To define a different default search you can do the following:
<textarea class="javascript">
grid.last.field = 'search_field'
grid.last.search = 'search_str'
</textarea>

To disable "all" search set <a class="argument" href="w2grid.show">.show.searchAll</a> to false.
<div style="height: 10px"></div>

For all possible search operators see <a class="argument" href="w2grid.operators">.operators</a>. Conversion map from column type to search operator type is defined in <a class="argument" href="w2grid.operatorsMap">.operatorsMap</a>.
<div style="height: 10px"></div>

The type of the search filed can be one of the following:
<ul>
    <li>text</li>
    <li>int</li>
    <li>float</li>
    <li>money</li>
    <li>currency - same as money</li>
    <li>percent</li>
    <li>hex</li>
    <li>color - same as hex</li>
    <li>alphanumeric</li>
    <li>date</li>
    <li>time</li>
    <li>datetime</li>
    <li>list</li>
    <li>combo</li>
    <li>enum</li>
</ul>

You can control search from JavaScript, see following methods for more information:
<div style="height: 10px"></div>

<ul>
    <li><a href="w2grid.search" class="method">.search()</a> - submit a search</li>
    <li><a href="w2grid.searchOpen" class="method">.searchOpen()</a> - open search dialog</li>
    <li><a href="w2grid.searchClose" class="method">.searchClose()</a> - close search dialog</li>
    <li><a href="w2grid.searchReset" class="method">.searchReset()</a> - reset all search fields to default values</li>
</ul>

<h4>See Also</h4>

<a href="w2grid.operators">operators</a> - default operators for each search type<br>
<a href="w2grid.operatorsMap">operatorsMap</a> - default operator for each search type<br>
